package SimpleDateFormat;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Test2 {
    public static void main(String[] args) throws ParseException {
        String startTime = "2021-11-11 00:00:00";
        String endTime = "2021-11-11 00:10:00";

        String xiaojia = "2021-11-11 00:03:47";
        String xiaopi = "2021-11-11 00:10:11";

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date startDate = simpleDateFormat.parse(startTime);
        Date endDate = simpleDateFormat.parse(endTime);
        Date jiaDate = simpleDateFormat.parse(xiaojia);
        Date piDate = simpleDateFormat.parse(xiaopi);
        if(jiaDate.after(startDate)&&jiaDate.before(endDate)){
            System.out.println("小贾购买成功");
        }else{
            System.out.println("小贾购买失败");
        }
        if(piDate.after(startDate)&&piDate.before(endDate)){
            System.out.println("小皮购买成功");
        }else{
            System.out.println("小皮购买失败");
        }
    }
}
